<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Pragma" content="no-cache" />
<meta HTTP-equiv="Cache-Control" content="no-cache" />
<meta HTTP-equiv="Expires" content="0" /> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8">
<title>小天空管理平台</title>
#parse("baseView/static.html")
<style>

</style>
</head>
<body>
<div class="layui-layout-admin">
	<div class="layui-top">
		<div class="admin-login-box">
			<a class="logo" style="left: 0;" href="http://beginner.zhengjinfan.cn/demo/beginner_admin/">
				<span style="font-size: 22px;color:#009688">小天空管理平台</span>
			</a>
		</div>
		<ul class="layui-nav list-Top-Muen" lay-filter="meun-top">
		  <li class="layui-nav-item"><a href="">最新活动</a></li>
		  <li class="layui-nav-item">
		    <a href="">产品</a>
		    <dl class="layui-nav-child">
		      <dd><a href="">选项1</a></dd>
		      <dd><a href="">选项2</a></dd>
		      <dd><a href="">选项3</a></dd>
		    </dl>
		  </li>
		  <li class="layui-nav-item"><a href="">大数据</a></li>
		  <li class="layui-nav-item">
		    <a href="javascript:;" class="admin-header-user">
			    <img src="${base.contextPath}/static/resources/images/0.jpg" />
				<span>小天空</span>
			</a>
		    <dl class="layui-nav-child">
			    <dd>
					<a href="javascript:;"><i class="fa fa-user-circle" aria-hidden="true"></i>个人信息</a>
				</dd>
				<dd>
					<a href="javascript:;"><i class="fa fa-gear" aria-hidden="true"></i> 设置</a>
				</dd>
				<dd>
					<a href="login.html"><i class="fa fa-sign-out" aria-hidden="true"></i> 注销</a>
				</dd>
		    </dl>
		  </li>
		</ul>
	</div>
	<div class="layui-left">
		<ul class="layui-nav layui-nav-tree layui-nav-side" lay-filter="meun-y" id="layuiMeun">
		  <li class="layui-nav-item layui-nav-itemed">
		    <a href="javascript:;">后台管理</a>
		    <dl class="layui-nav-child">
		      <dd><a href="javascript:void(0);" target = "${base.contextPath}/user/userManage"><i class="layui-icon">&#xe613;</i> 用户管理</a></dd>
		      <dd><a href="javascript:void(0);" target = "${base.contextPath}/user/userManage"><i class="layui-icon">&#xe60a;</i>菜单管理</a></dd>
		      <dd><a href="javascript:;"><i class="layui-icon">&#xe612;</i>角色管理</a></dd>
		    </dl>
		  </li>
		  <li class="layui-nav-item">
		    <a href="javascript:;">解决方案</a>
		    <dl class="layui-nav-child">
		      <dd><a href="javascript:;">移动模块</a></dd>
		      <dd><a href="">后台模版</a></dd>
		      <dd><a href="">电商平台</a></dd>
		    </dl>
		  </li>
		  <li class="layui-nav-item"><a href="">产品</a></li>
		  <li class="layui-nav-item"><a href="">大数据</a></li>
		</ul>
	</div>
	<div class="layer_content">
		<div class="layui-tab layui-tab-card" lay-allowClose="true" lay-filter="meun-x">
		  <ul class="layui-tab-title" id="topMeunId">
		    <li class="layui-this"><i class="layui-icon">&#xe62e;</i>首页</li>
		  </ul>
		  <div class="layui-tab-content" style="height:100%">
		    <div class="layui-tab-item layui-show">
		    	$screen_content
		    </div>
		  </div>
		</div>
		
	</div>
</div>
</body>
<script>
$(".layer_content").height($("#layuiMeun").height()-4); 
$(".layer_content").width($(".layui-top").width()-210);
$(".layui-tab-item").height($(".layer_content").height()-80);
var iframeHeight = $(".layui-tab-item").height()-2;
layui.use('element', function(){
	  var element = layui.element(); //导航的hover效果、二级菜单等功能，需要依赖element模块
	  
	  //监听导航点击
	  element.on('nav(meun-top)', function(elem){
	    console.log(elem)
	    //layer.msg(elem.text());
	  });
  
	element.on('nav(meun-y)', function(elem){
		var meunName = $(this).text();
		if($(this).find("a").find("i").length>0){
			meunName = meunName.substr(1,meunName.length);
		}
		var isHave = false;
		$("#topMeunId").each(function(){
		    var nameListStr = $(this).children().text();
		    if(nameListStr.indexOf(meunName) > 0 ){
		        //alert('含有');
		        isHave = true;
		    }
		});
	 	if(isHave){//打开菜单是否含有要打开的菜单
	 		return false;
	 	}
		element.tabAdd('meun-x', {
			  title: meunName,
			  skip: true, //开启跳页
			  content: '<iframe name="iframe" src="' + $(this).find("a").attr("target") + '" frameborder="0" style="width: 100%;height:'+iframeHeight+'px;"></iframe>' //支持传入html
			});
		element.tabChange('meun-x', $("#topMeunId li").length-1);
	});

});

layui.use('element', function(){
	  var element = layui.element();
	  //一些事件监听
	  element.on('tab(meun-x)', function(data){
		 //console.log(this); //当前Tab标题所在的原始DOM元素
		 //console.log(data.index); //得到当前Tab的所在下标
		 //console.log(data.elem); //得到当前的Tab大容器
		    //alert(this);
		   //alert($(this).html());
		    //alert(data.index);
		    //alert($(data.elem).html());
		    
	  });
	});

</script>
</html>